package com.wetao.lib_common.bean.vo;

import android.os.Parcel;
import android.os.Parcelable;

public class AnswerUiDataQuestion implements Parcelable{
    private int questionId;
    private int queueNumber;
    private boolean isWrite;
    private String answer;

    public AnswerUiDataQuestion() {

    }

    public AnswerUiDataQuestion(int questionId, int queueNumber, boolean isWrite, String answer) {
        this.questionId = questionId;
        this.queueNumber = queueNumber;
        this.isWrite = isWrite;
        this.answer = answer;
    }

    public static Creator<AnswerUiDataQuestion> getCREATOR() {
        return CREATOR;
    }

    public static final Creator<AnswerUiDataQuestion> CREATOR = new Creator<AnswerUiDataQuestion>() {
        @Override
        public AnswerUiDataQuestion createFromParcel(Parcel in) {
            return new AnswerUiDataQuestion(in);
        }

        @Override
        public AnswerUiDataQuestion[] newArray(int size) {
            return new AnswerUiDataQuestion[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    protected AnswerUiDataQuestion(Parcel in) {
        readFromParcel(in);
    }

    @Override
    public void writeToParcel(Parcel out, int flags) {
        out.writeInt(questionId);
        out.writeInt(queueNumber);
        out.writeByte((byte)(isWrite ?1:0));
        out.writeString(answer);
    }

    private void readFromParcel(Parcel in) {
        questionId = in.readInt();
        queueNumber = in.readInt();
        isWrite =in.readByte()!=0;
        answer = in.readString();
    }


    public int getQuestionId() {
        return questionId;
    }

    public void setQuestionId(int questionId) {
        this.questionId = questionId;
    }

    public int getQueueNumber() {
        return queueNumber;
    }

    public void setQueueNumber(int queueNumber) {
        this.queueNumber = queueNumber;
    }

    public boolean isWrite() {
        return isWrite;
    }

    public void setWrite(boolean write) {
        isWrite = write;
    }

    public String getAnswer() {
        return answer;
    }

    public void setAnswer(String answer) {
        this.answer = answer;
    }

    @Override
    public String toString() {
        return "AnswerUiDataQuestion{" +
                "questionId=" + questionId +
                ", queueNumber=" + queueNumber +
                ", isWrite=" + isWrite +
                ", answer='" + answer + '\'' +
                '}';
    }
}
